<!DOCTYPE html>
<!--解决idea thymeleaf 表达式模板报红波浪线-->
<!--suppress ALL -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 引入公用部分 -->
    <script th:replace="head::static"></script>
    <!-- 样式 -->
    <link th:href="@{/css/common.css}" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="layui-row layui-col-space15">
    <!-- 树 -->
    <div class="layui-col-md6">
        <div class="layui-card">
            <div class="layui-card-header">权限列表</div>
            <div class="layui-card-body">
                <!-- 表格主体 -->
                <table class="layui-hide" id="authorityTable" lay-filter="test"></table>
                <!-- 模板 -->
                <script type="text/html" id="authorityTableToolbarDemo">
                    <div class="layui-btn-container">
                        <button class="layui-btn layui-btn-sm" lay-event="addData">新增</button>
                        <input type="text" id="queryByAuthorityName" name="queryByAuthorityName" autocomplete="off"
                               placeholder="请输入权限名称" class="layui-input layui-btn-sm">
                        <button class="layui-btn layui-btn-sm" lay-event="query">查询</button>
                    </div>
                </script>
                <script type="text/html" id="authorityTableBarDemo">
                    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                    <a class="layui-btn layui-btn-xs" lay-event="auth">授权</a>
                    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                </script>
            </div>
        </div>
    </div>
    <!-- 操作表单 -->
    <div class="layui-col-md6">
        <div class="layui-card">
            <div class="layui-card-header">操作表单</div>
            <div class="layui-card-body">
                <form id="authorityForm" class="layui-form layui-form-pane">
                    <div class="layui-form-item">
                        <label class="layui-form-label">角色名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="roleName" autocomplete="off" placeholder="权限名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">角色key</label>
                        <div class="layui-input-block">
                            <input type="text" name="roleKey" autocomplete="off" placeholder="权限key"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">数据范围</label>
                        <div class="layui-input-block">
                            <input type="radio" name="dataScope" value="0" title="所有数据权限">
                            <input type="radio" name="dataScope" value="1" title="本部门数据权限">
                            <input type="radio" name="dataScope" value="2" title="本部门及以下数据权限">
                            <input type="radio" name="dataScope" value="3" title="自定义数据权限">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">角色状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="0" title="正常">
                            <input type="radio" name="status" value="1" title="停用">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <a class="layui-btn" onclick="authorityFormSave()">保存</a>
                        </div>
                    </div>
                    <!-- 隐藏域 -->
                    <input type="text" name="id" hidden="hidden"/>
                </form>
                <form id="menuForm" class="layui-form layui-form-pane" style="display: none;">
                <div class="layui-form-item">
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend>菜单权限</legend>
                    </fieldset>
                    <div id="roleMenuTree" class="demo-tree demo-tree-box layui-col-md6"
                         style="height: 500px; overflow: scroll;"></div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <a class="layui-btn" onclick="menuFormSave()">保存</a>
                    </div>
                </div>
                    <input type="text" id="roleid" hidden="hidden"/>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
<!-- js -->
<script th:src="@{/js/sys/authority/authority.js}"></script>
</html>